import request from './request.ts'

//拉取页面路由
export const getRouters = async  (data:Object) => {
    return await request({
        url: '/getRouters',
        method: 'get',
        data:data,
        loading: true,
    })
}
//拉取用户信息
export const getInfo = async  (data:Object) => {
    return await request({
        url: '/getInfo',
        method: 'get',
        data:data,
        loading: true,
    })
}
//登陆获取token
export const login = async  (data:Object) => {
    return await request({
        url: '/user/login',
        method: 'post',
        data:data,
        loading: true,
    })
}
//获取验证码
export const captchaImage = () => {
    return request({
        url: '/captcha',
        method: 'get',
        loading: false,
    })
}


export const logout = async  (userId) => {
    return await request({
        url: '/user/logout',
        method: 'post',
        data:{
            userId:userId
        },
        loading: true,
    })
}